package tutor.mina.server;

import java.util.Date;

import org.apache.mina.common.IoHandlerAdapter;
import org.apache.mina.common.IoSession;

public class TimeServerHandler extends IoHandlerAdapter {

    @Override
    public void messageSent( final IoSession session, final Object message )
        throws Exception {
        session.close();
    }

    @Override
    public void sessionOpened( final IoSession session )
        throws Exception {
        session.write( new Date() );
    }

}